#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
using namespace std;
int cmp(int a,int b){
    return a>b;
}
int main(){
    int arr[1005];
    int n;
    cin>>n;
    for(int  i=0;i<n;i++)
        cin>>arr[i];
    sort(arr,arr+n,cmp);
    cout<<arr[0]<<" "<<arr[1]<<" "<<arr[2]<<" "<<arr[3]<<" "<<arr[4]<<endl;
    return  0;
}
